<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommentsTable extends Migration
{
    //提交
    public function up()
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->increments('id');
            $table->text('content')->comment('评论内容');
            $table->integer('user_id')->comment('用户编号');
            $table->integer('article_id')->comment('文章编号');
            $table->string('images')->default('')->comment('头像|image');
            $table->tinyInteger('status')->default(0)->comment('审核状态|0:待审核|1:通过审核');
            $table->timestamps();
        });
    }

    //回滚
    public function down()
    {
        Schema::dropIfExists('comments');
    }
}
